import { S } from '../../s';
import { IPSChartCoordinateSystem } from './ipschart-coordinate-system';
import { IPSChartCoordinateSystemControl } from './ipschart-coordinate-system-control';
import { IPSDEChart } from './ipsdechart';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEChartCoordinateSystemControlImplBase
  extends PSModelObjectImpl
  implements IPSChartCoordinateSystemControl
{
  get baseOptionJOString(): string {
    return this.M.baseOptionJOString;
  }

  get index(): number {
    return this.M.index;
  }

  protected pschartcoordinatesystem: IPSChartCoordinateSystem;
  getPSChartCoordinateSystem(): IPSChartCoordinateSystem | null {
    if (this.pschartcoordinatesystem != null)
      return this.pschartcoordinatesystem;
    const value = this.M.getPSChartCoordinateSystem;
    if (value == null) {
      return;
    }
    const ipsdechart = this.getParentPSModelObject(S._253) as IPSDEChart;
    if (ipsdechart != null) {
      this.pschartcoordinatesystem =
        ipsdechart.findPSChartCoordinateSystem(value);
    }
    return this.pschartcoordinatesystem;
  }

  get type(): string {
    return this.M.type;
  }
  get cls(): string {
    return 'PSDEChartCoordinateSystemControlImplBase';
  }
  instanceof(cls: string): boolean {
    if (cls == S._de) return true;
    return super.instanceof(cls);
  }
}
